package factory.simple;

import factory.Milk;
import factory.Telunsu;

/**
 * @author wangkaiqiang
 * @title: SimpleFactoryTest
 * @projectName DesignPattern
 * @description: 简单工厂模型测试
 * @date 2019/6/239:51
 */
public class SimpleFactoryTest {

    public static void main(String[] args) {
        //直接new一个对象
        System.out.println(new Telunsu().getName());
        // 简单工厂生产一个对象
        SimpleFactory factory = new SimpleFactory();
        //可能会传错名字
        Milk milk = factory.getMilk("特仑苏");
        if(milk != null){
            System.out.println();
        }

    }
}
